# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ContainerAnalysis.V1alpha1.Model.SlsaProvenanceZeroTwo do
  @moduledoc """
  SlsaProvenanceZeroTwo is the slsa provenance as defined by the slsa spec. See full explanation of fields at slsa.dev/provenance/v0.2.

  ## Attributes

  *   `buildConfig` (*type:* `map()`, *default:* `nil`) - Lists the steps in the build.
  *   `buildType` (*type:* `String.t`, *default:* `nil`) - URI indicating what type of build was performed.
  *   `builder` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.GoogleDevtoolsContaineranalysisV1alpha1SlsaProvenanceZeroTwoSlsaBuilder.t`, *default:* `nil`) - Identifies the entity that executed the recipe, which is trusted to have correctly performed the operation and populated this provenance.
  *   `invocation` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.GoogleDevtoolsContaineranalysisV1alpha1SlsaProvenanceZeroTwoSlsaInvocation.t`, *default:* `nil`) - Identifies the event that kicked off the build.
  *   `materials` (*type:* `list(GoogleApi.ContainerAnalysis.V1alpha1.Model.GoogleDevtoolsContaineranalysisV1alpha1SlsaProvenanceZeroTwoSlsaMaterial.t)`, *default:* `nil`) - The collection of artifacts that influenced the build including sources, dependencies, build tools, base images, and so on.
  *   `metadata` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.GoogleDevtoolsContaineranalysisV1alpha1SlsaProvenanceZeroTwoSlsaMetadata.t`, *default:* `nil`) - Other properties of the build.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :buildConfig => map() | nil,
          :buildType => String.t() | nil,
          :builder =>
            GoogleApi.ContainerAnalysis.V1alpha1.Model.GoogleDevtoolsContaineranalysisV1alpha1SlsaProvenanceZeroTwoSlsaBuilder.t()
            | nil,
          :invocation =>
            GoogleApi.ContainerAnalysis.V1alpha1.Model.GoogleDevtoolsContaineranalysisV1alpha1SlsaProvenanceZeroTwoSlsaInvocation.t()
            | nil,
          :materials =>
            list(
              GoogleApi.ContainerAnalysis.V1alpha1.Model.GoogleDevtoolsContaineranalysisV1alpha1SlsaProvenanceZeroTwoSlsaMaterial.t()
            )
            | nil,
          :metadata =>
            GoogleApi.ContainerAnalysis.V1alpha1.Model.GoogleDevtoolsContaineranalysisV1alpha1SlsaProvenanceZeroTwoSlsaMetadata.t()
            | nil
        }

  field(:buildConfig, type: :map)
  field(:buildType)

  field(:builder,
    as:
      GoogleApi.ContainerAnalysis.V1alpha1.Model.GoogleDevtoolsContaineranalysisV1alpha1SlsaProvenanceZeroTwoSlsaBuilder
  )

  field(:invocation,
    as:
      GoogleApi.ContainerAnalysis.V1alpha1.Model.GoogleDevtoolsContaineranalysisV1alpha1SlsaProvenanceZeroTwoSlsaInvocation
  )

  field(:materials,
    as:
      GoogleApi.ContainerAnalysis.V1alpha1.Model.GoogleDevtoolsContaineranalysisV1alpha1SlsaProvenanceZeroTwoSlsaMaterial,
    type: :list
  )

  field(:metadata,
    as:
      GoogleApi.ContainerAnalysis.V1alpha1.Model.GoogleDevtoolsContaineranalysisV1alpha1SlsaProvenanceZeroTwoSlsaMetadata
  )
end

defimpl Poison.Decoder, for: GoogleApi.ContainerAnalysis.V1alpha1.Model.SlsaProvenanceZeroTwo do
  def decode(value, options) do
    GoogleApi.ContainerAnalysis.V1alpha1.Model.SlsaProvenanceZeroTwo.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ContainerAnalysis.V1alpha1.Model.SlsaProvenanceZeroTwo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
